import { createWebHistory, createRouter } from "vue-router";
import Layout from "@/layout";

/**
 * Note: 路由配置项
 *
 * hidden: true                     // 当设置 true 的时候该路由不会再侧边栏出现 如401，login等页面，或者如一些编辑页面/edit/1
 * alwaysShow: true                 // 当你一个路由下面的 children 声明的路由大于1个时，自动会变成嵌套的模式--如组件页面
 *                                  // 只有一个时，会将那个子路由当做根路由显示在侧边栏--如引导页面
 *                                  // 若你想不管路由下面的 children 声明的个数都显示你的根路由
 *                                  // 你可以设置 alwaysShow: true，这样它就会忽略之前定义的规则，一直显示根路由
 * redirect: noRedirect             // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
 * name:'router-name'               // 设定路由的名字，一定要填写不然使用<keep-alive>时会出现各种问题
 * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数
 * meta : {
    noCache: true                   // 如果设置为true，则不会被 <keep-alive> 缓存(默认 false)
    title: 'title'                  // 设置该路由在侧边栏和面包屑中展示的名字
    icon: 'svg-name'                // 设置该路由的图标，对应路径src/assets/icons/svg
    breadcrumb: false               // 如果设置为false，则不会在breadcrumb面包屑中显示
    activeMenu: '/system/user'      // 当路由设置了该属性，则会高亮相对应的侧边栏。
  }
 */

// 公共路由
export const constantRoutes = [
  {
    path: "/redirect",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "/redirect/:path(.*)",
        component: () => import("@/views/redirect/index.vue"),
      },
    ],
  },
  {
    path: "/login",
    component: () => import("@/views/login"),
    meta: { title: "登录", icon: "password" },
    hidden: true,
  },
  {
    path: "/register",
    component: () => import("@/views/register"),
    meta: { title: "注册", icon: "password" },
    hidden: true,
  },
  {
    path: "/forgotPassword",
    component: () => import("@/views/forgotPassword"),
    meta: { title: "忘记密码", icon: "password" },
    hidden: true,
  },
  {
    path: "/viewItemFile",
    component: () => import("@/views/viewItemFile"),
    hidden: true,
  },
  {
    path: "/:pathMatch(.*)*",
    component: () => import("@/views/error/404"),
    hidden: true,
  },
  {
    path: "/401",
    component: () => import("@/views/error/401"),
    meta: { title: "错误", icon: "error" },
    hidden: true,
  },
  {
    path: "/",
    component: Layout,
    redirect: "/home/index",
    meta: { title: "首页", icon: "home" },
    children: [
      {
        path: "/home",
        redirect:'/home/index',
        component: () => import("@/views/mainIndex"),
        name: "home",
        meta: { title: "首页", icon: "home" },
        noMenu: true,
        children:[
          {
            path: "/home/index",
            component: () => import("@/views/index"),
            name: "index",
            meta: { title: "首页", icon: "index" },
          },
          {
            path: "/home/accessRanking",
            component: () => import("@/views/index/accessRanking"),
            name: "accessRanking",
            meta: { title: "访问排行", icon: "accessRanking",breadcrumbList:[{name:'首页',url:'/home/index'},{name:'访问排行',color:true}] },
          },
          {
            path: "/home/latestProfile",
            component: () => import("@/views/index/latestProfile"),
            name: "latestProfile",
            meta: { title: "最新资料", icon: "latestProfile",breadcrumbList:[{name:'首页',url:'/home/index'},{name:'最新资料',color:true}]},
          },
          {
            path: "/home/latestCase",
            component: () => import("@/views/index/latestCase"),
            name: "latestCase",
            meta: { title: "最新案例", icon: "latestCase",breadcrumbList:[{name:'首页',url:'/home/index'},{name:'最新案例',color:true}]},
          },
          {
            path: "/home/searchMessage",
            component: () => import("@/views/index/searchMessage"),
            name: "searchMessage",
            meta: { title: "检索信息", icon: "searchMessage",breadcrumbList:[{name:'首页',url:'/home/index'},{name:'检索信息',color:true}]},
          },
        ]
      },
      {
        path: "/thematicMap",
        component: () => import("@/views/thematicMap/main"),
        hidden: true,
        redirect: "/thematicMap/probeClass/activeFault",
        meta: { title: "专题图", icon: "thematicMap" },
        children: [
          {
            path: "/thematicMap/probeClass",
            redirect: "/thematicMap/probeClass/activeFault",
            component: () => import("@/views/thematicMap/probeClass/main"),
            name: "probeClass",
            meta: { title: "探查类", icon: "probeClass" },
            children: [
              {
                path: "/thematicMap/probeClass/activeFault",
                component: () => import("@/views/thematicMap/probeClass/activeFault/index"),
                name: "activeFault",
                meta: { title: "活断层分布图", icon: "activeFault", noCache: true, breadcrumbList: [{ name: '专题图' }, { name: '探查类' }, { name: '活断层分布图', url: '/thematicMap/probeClass/activeFault', color: true }], },
                noMenu: true,
                children: [{
                  path: "/thematicMap/probeClass/activeFault/activeFaultDetail",
                  component: () => import("@/views/thematicMap/probeClass/activeFault/activeFaultDetail.vue"),
                  name: "activeFaultDetail",
                  meta: { title: "详情", icon: "activeFaultDetail", noCache: true, breadcrumbList: [{ name: '专题图' }, { name: '探查类' }, { name: '活断层分布图', url: '/thematicMap/probeClass/activeFault' }, { name: '详情', url: '/thematicMap/probeClass/activeFault/activeFaultDetail', color: true }], },
                },]
              },
              {
                path: "/thematicMap/probeClass/activeFaultAvoidance",
                // component: () => import("@/views/thematicMap/probeClass/activeFaultAvoidance/index"),
                component: () => import("@/views/thematicMap/probeClass/activeFaultAvoidance/map/index"),
                name: "activeFaultAvoidance",
                meta: { title: "活断层避让分布图", icon: "activeFaultAvoidance", noCache: true,breadcrumbList: [{ name: '专题图' }, { name: '探查类' }, { name: '活断层避让分布图', url: '/thematicMap/probeClass/activeFaultAvoidance', color: true }], },
                noMenu: true,
                children: [{
                  path: "/thematicMap/probeClass/activeFaultAvoidance/activeFaultAvoidanceDetail",
                  component: () => import("@/views/thematicMap/probeClass/activeFaultAvoidance/activeFaultAvoidanceDetail.vue"),
                  name: "activeFaultAvoidanceDetail",
                  meta: { title: "详情", icon: "activeFaultAvoidanceDetail", noCache: true ,breadcrumbList: [{ name: '专题图' }, { name: '探查类' }, { name: '活断层避让分布图', url: '/thematicMap/probeClass/activeFaultAvoidance' }, { name: '详情', url: '/thematicMap/probeClass/activeFaultAvoidance/activeFaultAvoidanceDetail', color: true }]},
                  
                },]
              },
              {
                path: "/thematicMap/probeClass/seismicReinforcement",
                component: () => import("@/views/thematicMap/probeClass/seismicReinforcement/index"),
                name: "seismicReinforcement",
                meta: { title: "抗震加固工程分布图", icon: "seismicReinforcement", noCache: true,breadcrumbList: [{ name: '专题图' }, { name: '探查类' }, { name: '抗震加固工程分布图', url: '/thematicMap/probeClass/seismicReinforcement', color: true }], },
              },
            ]
          },
          {
            path: "/thematicMap/divisionClass",
            redirect: "/thematicMap/divisionClass/earthquakeDisasterRisk",
            component: () => import("@/views/thematicMap/divisionClass/main"),
            name: "divisionClass",
            meta: { title: "区划类", icon: "divisionClass" },
            children: [
              {
                path: "/thematicMap/divisionClass/earthquakeDisasterRisk",
                component: () => import("@/views/thematicMap/divisionClass/earthquakeDisasterRisk/index"),
                name: "earthquakeDisasterRisk",
                meta: { title: "全国地震灾害风险区划图", icon: "earthquakeDisasterRisk", noCache: true,breadcrumbList: [{ name: '专题图' }, { name: '区划类' }, { name: '全国地震灾害风险区划图', url: '/thematicMap/divisionClass/earthquakeDisasterRisk', color: true }], },
                
              },
              {
                path: "/thematicMap/divisionClass/houseReinforcementPriority",
                component: () => import("@/views/thematicMap/divisionClass/houseReinforcementPriority/index"),
                name: "houseReinforcementPriority",
                meta: { title: "房屋加固优先级区划图", icon: "houseReinforcementPriority", noCache: true ,breadcrumbList: [{ name: '专题图' }, { name: '区划类' }, { name: '房屋加固优先级区划图', url: '/thematicMap/divisionClass/houseReinforcementPriority', color: true }],},
              },
            ]
          },
          {
            path: "/thematicMap/evaluationClass",
            redirect: "/thematicMap/evaluationClass/keyHiddenDanger",
            component: () => import("@/views/thematicMap/evaluationClass/main"),
            name: "evaluationClass",
            meta: { title: "评估类", icon: "evaluationClass" },
            children: [
              {
                path: "/thematicMap/evaluationClass/keyHiddenDanger",
                component: () => import("@/views/thematicMap/evaluationClass/keyHiddenDanger/index"),
                name: "keyHiddenDanger",
                meta: { title: "重点隐患分布图", icon: "keyHiddenDanger", noCache: true ,breadcrumbList: [{ name: '专题图' }, { name: '评估类' }, { name: '重点隐患分布图', url: '/thematicMap/evaluationClass/keyHiddenDanger', color: true }],},
              },
              {
                path: "/thematicMap/evaluationClass/comprehensiveDisasterReduction",
                component: () => import("@/views/thematicMap/evaluationClass/comprehensiveDisasterReduction/index"),
                name: "comprehensiveDisasterReduction",
                meta: { title: "综合减灾社区分布图", icon: "comprehensiveDisasterReduction", noCache: true ,breadcrumbList: [{ name: '专题图' }, { name: '评估类' }, { name: '综合减灾社区分布图', url: '/thematicMap/evaluationClass/comprehensiveDisasterReduction', color: true }],},
                noMenu: true,
                children: [{
                  path: "/thematicMap/evaluationClass/comprehensiveDisasterReduction/comprehensiveDisasterReductionDetail",
                  component: () => import("@/views/thematicMap/evaluationClass/comprehensiveDisasterReduction/comprehensiveDisasterReductionDetail.vue"),
                  name: "comprehensiveDisasterReductionDetail",
                  meta: { title: "详情", icon: "comprehensiveDisasterReductionDetail", noCache: true ,breadcrumbList: [{ name: '专题图' }, { name: '评估类' }, { name: '综合减灾社区分布图', url: '/thematicMap/evaluationClass/comprehensiveDisasterReduction' }, { name: '详情', url: '/thematicMap/evaluationClass/comprehensiveDisasterReduction/comprehensiveDisasterReductionDetail' }],},
                },]
              },
              {
                path: "/thematicMap/evaluationClass/geologicalHazardRisk",
                component: () => import("@/views/thematicMap/evaluationClass/geologicalHazardRisk/index"),
                name: "geologicalHazardRisk",
                meta: { title: "地质灾害危险性分布图", icon: "geologicalHazardRisk", noCache: true ,breadcrumbList: [{ name: '专题图' }, { name: '评估类' }, { name: '地质灾害危险性分布图', url: '/thematicMap/evaluationClass/geologicalHazardRisk', color: true }],},
                noMenu: true,
                children: [{
                  path: "/thematicMap/evaluationClass/geologicalHazardRisk/geologicalHazardRiskDetail",
                  component: () => import("@/views/thematicMap/evaluationClass/geologicalHazardRisk/geologicalHazardRiskDetail.vue"),
                  name: "geologicalHazardRiskDetail",
                  meta: { title: "详情", icon: "geologicalHazardRiskDetail", noCache: true ,breadcrumbList: [{ name: '专题图' }, { name: '评估类' }, { name: '地质灾害危险性分布图', url: '/thematicMap/evaluationClass/geologicalHazardRisk' }, { name: '详情', url: '/thematicMap/evaluationClass/geologicalHazardRisk/geologicalHazardRiskDetail' }],},
                },]
              }
            ]
          },
          {
            path: "/thematicMap/synthesis",
            redirect: "/thematicMap/synthesis/nationalSynthesis",
            component: () => import("@/views/thematicMap/synthesis/main"),
            name: "synthesis",
            meta: { title: "综合类", icon: "synthesis" },
            children: [
              {
                path: "/thematicMap/synthesis/nationalSynthesis",
                component: () => import("@/views/thematicMap/synthesis/nationalSynthesis/index"),
                name: "nationalSynthesis",
                meta: { title: "全国综合", icon: "nationalSynthesis", noCache: true ,breadcrumbList: [{ name: '专题图' }, { name: '综合类' }, { name: '全国综合', url: '/thematicMap/synthesis/nationalSynthesis', color: true }],},
              },
              {
                path: "/thematicMap/synthesis/regionalSynthesis",
                component: () => import("@/views/thematicMap/synthesis/regionalSynthesis/index"),
                name: "regionalSynthesis",
                meta: { title: "区域综合", icon: "regionalSynthesis", noCache: true ,breadcrumbList: [{ name: '专题图' }, { name: '综合类' }, { name: '区域综合', url: '/thematicMap/synthesis/regionalSynthesis', color: true }],},
              },
            ]
          },
        ],
      },
      {
        path: "/informationAnalysis",
        redirect: "/informationAnalysis/customizedService",
        component: () => import("@/views/informationAnalysis/main"),
        hidden: true,
        meta: { title: "信息分析", icon: "informationAnalysis" },
        children: [
          {
            path: "/informationAnalysis/rapidSeismicEvaluaBuild",
            component: () => import("@/views/informationAnalysis/rapidSeismicEvaluaBuild/index.vue"),
            name: "rapidSeismicEvaluaBuild",
            meta: { title: "房屋抗震性能快速评估", icon: "rapidSeismicEvaluaBuild",breadcrumbList: [{ name: '信息分析' }, { name: '房屋抗震性能快速评估', color: true }], },
            noMenu: true,
          },
        ],
      },
      {
        path: "/informationResult",
        component: () => import("@/views/informationResult/main"),
        hidden: true,
        redirect: "/informationResult/evaluationReport/earthDamageLossPreEvaluation",
        meta: { title: "信息成果", icon: "informationResult" },
        children: [
          {
            path: "/informationResult/evaluationReport",
            redirect: "/informationResult/evaluationReport/earthDamageLossPreEvaluation",
            component: () => import("@/views/informationResult/evaluationReport/main"),
            name: "evaluationReport",
            meta: { title: "评估报告", icon: "evaluationReport" },
            children: [
              {
                path: "/informationResult/evaluationReport/earthDamageLossPreEvaluation",
                component: () => import("@/views/informationResult/evaluationReport/earthDamageLossPreEvaluation/index"),
                name: "earthDamageLossPreEvaluation",
                meta: { title: "地震灾害损失预评估", icon: "earthDamageLossPreEvaluation", noCache: true ,breadcrumbList: [{ name: '信息成果' }, { name: '评估报告' }, { name: '地震灾害损失预评估', url: '/informationResult/evaluationReport/earthDamageLossPreEvaluation', color: true }],},
              },
              {
                path: "/informationResult/evaluationReport/earthDamageLossEvaluation",
                component: () => import("@/views/informationResult/evaluationReport/earthDamageLossEvaluation/index"),
                name: "earthDamageLossEvaluation",
                meta: { title: "地震灾害损失评估", icon: "earthDamageLossEvaluation", noCache: true ,breadcrumbList: [{ name: '信息成果' }, { name: '评估报告' }, { name: '地震灾害损失评估', url: '/informationResult/evaluationReport/earthDamageLossEvaluation', color: true }],},
              },
              {
                path: "/informationResult/evaluationReport/majorEventRiskAssessment",
                component: () => import("@/views/informationResult/evaluationReport/majorEventRiskAssessment/index"),
                name: "majorEventRiskAssessment",
                meta: { title: "重大活动期间地震灾害风险评估", icon: "majorEventRiskAssessment", noCache: true,breadcrumbList: [{ name: '信息成果' }, { name: '评估报告' }, { name: '重大活动期间地震灾害风险评估', url: '/informationResult/evaluationReport/majorEventRiskAssessment', color: true }], },
              },
            ]
          },
          {
            path: "/informationResult/disasterReport",
            redirect: "/informationResult/disasterReport/investigationReportAndDeathCauses",
            component: () => import("@/views/informationResult/disasterReport/main"),
            name: "disasterReport",
            meta: { title: "灾情报表", icon: "disasterReport" },
            children: [
              {
                path: "/informationResult/disasterReport/investigationReportAndDeathCauses",
                component: () => import("@/views/informationResult/disasterReport/investigationReportAndDeathCauses/index"),
                name: "investigationReportAndDeathCauses",
                meta: { title: "地震现场人员伤亡分布及致死原因调查报表", icon: "investigationReportAndDeathCauses", noCache: true ,breadcrumbList: [{ name: '信息成果' }, { name: '灾情报表' }, { name: '地震现场人员伤亡分布及致死原因调查报表', url: '/informationResult/disasterReport/investigationReportAndDeathCauses', color: true }],},
              },
            ]
          },
        ],
      },
      {
        path: "/informationRetrieval",
        redirect: "/informationRetrieval/seismicParameter",
        component: () => import("@/views/informationRetrieval/main.vue"),
        hidden: true,
        meta: { title: "信息检索", icon: "informationRetrieval" },
        name:'informationRetrieval',
        // noMenu: true,
        children: [
          // {
          //   path: "/informationRetrieval/infoIndex",
          //   component: () => import("@/views/informationRetrieval/infoIndex/index.vue"),
          //   name:'infoIndex',
          //   noMenu: true,
          //   meta: { title: "信息检索", icon: "infoIndex",breadcrumbList:[{name:'信息检索'}] },
          // },
          {
            path: "/informationRetrieval/seismicParameter",
            component: () => import("@/views/informationRetrieval/seismicParameter/index.vue"),
            name:'seismicParameter',
            noMenu: true,
            meta: { title: "抗震设防参数", icon: "seismicParameter" ,breadcrumbList:[{name:'信息检索'},{name:'抗震设防参数',color:true}]},
          },
          {
            path: "/informationRetrieval/activeFaultInfo",
            component: () => import("@/views/informationRetrieval/activeFaultInfo/index.vue"),
            name:'activeFaultInfo',
            noMenu: true,
            meta: { title: "活断层信息", icon: "activeFaultInfo",breadcrumbList:[{name:'信息检索'},{name:'活断层信息',color:true}] },
          },
          {
            path: "/informationRetrieval/emergencyShelter",
            component: () => import("@/views/informationRetrieval/emergencyShelter/index.vue"),
            name:'emergencyShelter',
            noMenu: true,
            meta: { title: "应急避难场所", icon: "emergencyShelter",breadcrumbList:[{name:'信息检索'},{name:'应急避难场所',color:true}] },
          },
          {
            path: "/informationRetrieval/historicalSeismicInformation",
            component: () => import("@/views/informationRetrieval/historicalSeismicInformation/index.vue"),
            redirect:'/informationRetrieval/historicalSeismicInformation/historicalSeismicEvent',
            name:'historicalSeismicInformation',
            meta: { title: "历史地震信息", icon: "historicalSeismicInformation",breadcrumbList:[{name:'信息检索'},{name:'历史地震信息',color:true}] },
            children: [
              {
                path: "/informationRetrieval/historicalSeismicInformation/historicalSeismicEvent",
                component: () => import("@/views/informationRetrieval/historicalSeismicInformation/historicalSeismicEvent/index"),
                name: "historicalSeismicEvent",
                meta: { title: "历史地震事件", icon: "historicalSeismicEvent", noCache: true,breadcrumbList: [{ name: '信息检索' }, { name: '历史地震信息' }, { name: '历史地震事件', url: '/informationRetrieval/historicalSeismicInformation/historicalSeismicEvent', color: true }], },
                noMenu: true,
                children: [{
                  path: "/informationRetrieval/historicalSeismicInformation/historicalSeismicEvent/earthquakeDisasterDataDetail",
                  component: () => import("@/views/informationRetrieval/historicalSeismicInformation/historicalSeismicEvent/earthquakeDisasterDataDetail.vue"),
                  name: "earthquakeDisasterDataDetail",
                  meta: { title: "详情", icon: "earthquakeDisasterDataDetail", noCache: true ,breadcrumbList: [{ name: '信息检索' }, { name: '历史地震信息' }, { name: '历史地震事件', url: '/informationRetrieval/historicalSeismicInformation/historicalSeismicEvent' },{name:'详情',url:'/informationRetrieval/historicalSeismicInformation/historicalSeismicEvent/earthquakeDisasterDataDetail', color: true}],},
                },
                {
                  path: "/informationRetrieval/historicalSeismicInformation/historicalSeismicEvent/viewAll",
                  component: () => import("@/views/informationRetrieval/historicalSeismicInformation/historicalSeismicEvent/viewAll.vue"),
                  name: "viewAll",
                  meta: { title: "查看全部", icon: "viewAll", noCache: true ,breadcrumbList: [{ name: '信息检索' }, { name: '历史地震信息' }, { name: '历史地震事件', url: '/informationRetrieval/historicalSeismicInformation/historicalSeismicEvent' },{name:'查看全部',url:'/informationRetrieval/historicalSeismicInformation/historicalSeismicEvent/viewAll', color: true}],},
                }]
              },
              {
                path: "/informationRetrieval/historicalSeismicInformation/historicalDisasterInformation",
                component: () => import("@/views/informationRetrieval/historicalSeismicInformation/historicalDisasterInformation/index"),
                name: "historicalDisasterInformation",
                meta: { title: "地震灾害信息", icon: "historicalDisasterInformation", noCache: true,breadcrumbList: [{ name: '信息检索' }, { name: '历史地震信息' }, { name: '地震灾害信息', url: '/informationRetrieval/historicalSeismicInformation/historicalDisasterInformation', color: true }], },
                noMenu: true,
                children: [{
                  path: "/informationRetrieval/historicalSeismicInformation/historicalDisasterInformation/historicalDisasterDataDatil",
                  component: () => import("@/views/informationRetrieval/historicalSeismicInformation/historicalDisasterInformation/historicalDisasterDataDatil.vue"),
                  name: "historicalDisasterDataDatil",
                  meta: { title: "详情", icon: "historicalDisasterDataDatil", noCache: true ,breadcrumbList: [{ name: '信息检索' }, { name: '历史地震信息' }, { name: '地震灾害信息', url: '/informationRetrieval/historicalSeismicInformation/historicalDisasterInformation'},{name:'详情',url:'/informationRetrieval/historicalSeismicInformation/historicalDisasterInformation/historicalDisasterDataDatil',color:true}],},
                }]
              },
            ]
          },
        ],
      },
      {
        path: "/knowledgeLearn",
        redirect: "/knowledgeLearn/technicalData",
        component: () => import("@/views/knowledgeLearn/main"),
        hidden: true,
        meta: { title: "知识学习", icon: "knowledgeLearn" },
        children: [
          {
            path: "/knowledgeLearn/technicalData",
            component: () => import("@/views/knowledgeLearn/technicalData/index.vue"),
            name: "technicalData",
            meta: { title: "技术资料", icon: "technicalData" ,breadcrumbList: [{ name: '知识学习' }, { name: '技术资料',color:true }],},
            noMenu: true,
          },
          {
            path: "/knowledgeLearn/online",
            redirect: "/knowledgeLearn/online/onlineClassroom",
            component: () => import("@/views/knowledgeLearn/online/main.vue"),
            name: "online",
            meta: { title: "在线课堂", icon: "online" },
            children: [
              {
                path: "/knowledgeLearn/online/onlineClassroom",
                component: () => import("@/views/knowledgeLearn/online/onlineClassroom/index.vue"),
                name: "onlineClassroom",
                meta: { title: "在线课堂", icon: "onlineClassroom",breadcrumbList: [{ name: '知识学习' }, { name: '在线课堂' }, { name: '在线课堂', url: '/knowledgeLearn/online/onlineClassroom', color: true }], },
                noMenu: true,
                children: [
                  {
                    path: "/knowledgeLearn/online/onlineClassroom/practice",
                    component: () => import("@/views/knowledgeLearn/online/onlineClassroom/practice.vue"),
                    name: "practice",
                    meta: { title: "随堂练习", icon: "practice",breadcrumbList: [{ name: '知识学习' }, { name: '在线课堂' }, { name: '在线课堂', url: '/knowledgeLearn/online/onlineClassroom' },{name:'随堂练习',url:'/knowledgeLearn/online/onlineClassroom/practice',color:true}], },
                  }
                ]
              },
              {
                path: "/knowledgeLearn/online/practiceInClass",
                component: () => import("@/views/knowledgeLearn/online/practiceInClass/index.vue"),
                name: "practiceInClass",
                meta: { title: "随堂练习", icon: "practiceInClass",breadcrumbList: [{ name: '知识学习' }, { name: '在线课堂', url: '/knowledgeLearn/online/onlineClassroom' }, { name: '随堂练习', url: '/knowledgeLearn/online/practiceInClass', color: true }], },
                noMenu: true,
                children: [
                  {
                    path: "/knowledgeLearn/online/practiceInClass/checkAnswer",
                    component: () => import("@/views/knowledgeLearn/online/practiceInClass/checkAnswer.vue"),
                    name: "checkAnswer",
                    meta: { title: "查看答案", icon: "checkAnswer",breadcrumbList: [{ name: '知识学习' }, { name: '在线课堂' }, { name: '随堂练习', url: '/knowledgeLearn/online/practiceInClass' },{name:'查看答案',url:'/knowledgeLearn/online/practiceInClass/checkAnswer',color:true}], },
                  },
                  {
                    path: "/knowledgeLearn/online/practiceInClass/list",
                    component: () => import("@/views/knowledgeLearn/online/practiceInClass/list.vue"),
                    name: "list",
                    meta: { title: "排行榜", icon: "list",breadcrumbList: [{ name: '知识学习' }, { name: '在线课堂' }, { name: '随堂练习', url: '/knowledgeLearn/online/practiceInClass' },{name:'排行榜',url:'/knowledgeLearn/online/practiceInClass/list',color:true}], },
                  },
                  {
                    path: "/knowledgeLearn/online/practiceInClass/myCertificate",
                    component: () => import("@/views/knowledgeLearn/online/practiceInClass/myCertificate.vue"),
                    name: "myCertificate",
                    meta: { title: "我的证书", icon: "myCertificate",breadcrumbList: [{ name: '知识学习' }, { name: '在线课堂' }, { name: '随堂练习', url: '/knowledgeLearn/online/practiceInClass' },{name:'我的证书',url:'/knowledgeLearn/online/practiceInClass/myCertificate',color:true}], },
                  },
                  {
                    path: "/knowledgeLearn/online/practiceInClass/fractionalGraph",
                    component: () => import("@/views/knowledgeLearn/online/practiceInClass/fractionalGraph.vue"),
                    name: "fractionalGraph",
                    meta: { title: "分数图", icon: "fractionalGraph",breadcrumbList: [{ name: '知识学习' }, { name: '在线课堂' }, { name: '随堂练习', url: '/knowledgeLearn/online/practiceInClass' },{name:'分数图',url:'/knowledgeLearn/online/practiceInClass/fractionalGraph',color:true}], },
                  }
                ]
              },
            ]
          },
          {
            path: "/knowledgeLearn/regulatoryStandard",
            component: () => import("@/views/knowledgeLearn/regulatoryStandard/index.vue"),
            name: "regulatoryStandard",
            meta: { title: "法规标准", icon: "regulatoryStandard",breadcrumbList: [{ name: '知识学习' }, { name: '法规标准',color:true }], },
            noMenu: true,
          },
          {
            path: "/knowledgeLearn/popularScienceKnowledge",
            component: () => import("@/views/knowledgeLearn/popularScienceKnowledge/index.vue"),
            name: "popularScienceKnowledge",
            meta: { title: "科普知识", icon: "popularScienceKnowledge", breadcrumbList: [{ name: '知识学习' }, { name: '科普知识',color:true }], },
            noMenu: true,
          },
        ],
      },
      {
        path: "/serviceCase",
        redirect: "/serviceCase/customizedService",
        component: () => import("@/views/serviceCase/main"),
        hidden: true,
        meta: { title: "服务案例", icon: "serviceCase" },
        children: [
          {
            path: "/serviceCase/customizedService",
            component: () => import("@/views/serviceCase/customizedService/index.vue"),
            name: "customizedService",
            meta: { title: "定制服务", icon: "customizedService",breadcrumbList: [{ name: '服务案例' }, { name: '定制服务',color:true }], },
            noMenu: true,
          },
          {
            path: "/serviceCase/typicalCase",
            component: () => import("@/views/serviceCase/typicalCase/index.vue"),
            name: "typicalCase",
            meta: { title: "典型案例", icon: "typicalCase" ,breadcrumbList: [{ name: '服务案例' }, { name: '典型案例',color:true }],},
            noMenu: true,
          },
        ],
      },
    ],
  },
];

const router = createRouter({
  history: createWebHistory(import.meta.env.VITE_APP_ROUTE),
  routes: constantRoutes,
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition;
    } else {
      return { 
        left: 0,
        top: 0 
      };
    }
  },
});

export default router;
